3.4.88 \(\int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx\) [388]

3.4.88.1 Optimal result
3.4.88.2 Mathematica [A] (verified)
3.4.88.3 Rubi [A] (verified)
3.4.88.4 Maple [B] (verified)
3.4.88.5 Fricas [A] (verification not implemented)
3.4.88.6 Sympy [F]
3.4.88.7 Maxima [F]
3.4.88.8 Giac [A] (verification not implemented)
3.4.88.9 Mupad [F(-1)]

3.4.88.1 Optimal result

Integrand size = 34, antiderivative size = 78 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a+a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {2 C \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \]

output
(B-C)*arctan(1/2*a^(1/2)*tan(d*x+c)*2^(1/2)/(a+a*sec(d*x+c))^(1/2))*2^(1/2 
)/d/a^(1/2)+2*C*tan(d*x+c)/d/(a+a*sec(d*x+c))^(1/2)
 
3.4.88.2 Mathematica [A] (verified)

Time = 0.23 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.13 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=\frac {\left (\sqrt {2} (B-C) \text {arctanh}\left (\frac {\sqrt {1-\sec (c+d x)}}{\sqrt {2}}\right )+2 C \sqrt {1-\sec (c+d x)}\right ) \tan (c+d x)}{d \sqrt {1-\sec (c+d x)} \sqrt {a (1+\sec (c+d x))}} \]

input
Integrate[(B*Sec[c + d*x] + C*Sec[c + d*x]^2)/Sqrt[a + a*Sec[c + d*x]],x]
 
output
((Sqrt[2]*(B - C)*ArcTanh[Sqrt[1 - Sec[c + d*x]]/Sqrt[2]] + 2*C*Sqrt[1 - S 
ec[c + d*x]])*Tan[c + d*x])/(d*Sqrt[1 - Sec[c + d*x]]*Sqrt[a*(1 + Sec[c + 
d*x])])
 
3.4.88.3 Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3042, 4542, 27, 3042, 4282, 216}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a \sec (c+d x)+a}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2}{\sqrt {a \csc \left (c+d x+\frac {\pi }{2}\right )+a}}dx\)

\(\Big \downarrow \) 4542

\(\displaystyle \frac {2 \int \frac {a (B-C) \sec (c+d x)}{2 \sqrt {\sec (c+d x) a+a}}dx}{a}+\frac {2 C \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 27

\(\displaystyle (B-C) \int \frac {\sec (c+d x)}{\sqrt {\sec (c+d x) a+a}}dx+\frac {2 C \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 3042

\(\displaystyle (B-C) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{\sqrt {\csc \left (c+d x+\frac {\pi }{2}\right ) a+a}}dx+\frac {2 C \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}\)

\(\Big \downarrow \) 4282

\(\displaystyle \frac {2 C \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}-\frac {2 (B-C) \int \frac {1}{\frac {a^2 \tan ^2(c+d x)}{\sec (c+d x) a+a}+2 a}d\left (-\frac {a \tan (c+d x)}{\sqrt {\sec (c+d x) a+a}}\right )}{d}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\sqrt {2} (B-C) \arctan \left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a \sec (c+d x)+a}}\right )}{\sqrt {a} d}+\frac {2 C \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}}\)

input
Int[(B*Sec[c + d*x] + C*Sec[c + d*x]^2)/Sqrt[a + a*Sec[c + d*x]],x]
 
output
(Sqrt[2]*(B - C)*ArcTan[(Sqrt[a]*Tan[c + d*x])/(Sqrt[2]*Sqrt[a + a*Sec[c + 
 d*x]])])/(Sqrt[a]*d) + (2*C*Tan[c + d*x])/(d*Sqrt[a + a*Sec[c + d*x]])
 

3.4.88.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4282
Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_S 
ymbol] :> Simp[-2/f   Subst[Int[1/(2*a + x^2), x], x, b*(Cot[e + f*x]/Sqrt[ 
a + b*Csc[e + f*x]])], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]
 

rule 4542
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Simp[(-C)*Cot 
[e + f*x]*((a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[1/(b*(m + 1))   I 
nt[(a + b*Csc[e + f*x])^m*Simp[A*b*(m + 1) + (a*C*m + b*B*(m + 1))*Csc[e + 
f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && EqQ[a^2 - b^2, 0] 
 &&  !LtQ[m, -2^(-1)]
 
3.4.88.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(193\) vs. \(2(67)=134\).

Time = 0.72 (sec) , antiderivative size = 194, normalized size of antiderivative = 2.49

method result size
default \(\frac {\sqrt {-\frac {2 a}{\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}}\, \left (B \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}\right ) \sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}-C \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+\sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}\right ) \sqrt {\left (1-\cos \left (d x +c \right )\right )^{2} \csc \left (d x +c \right )^{2}-1}+2 C \left (-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )\right )}{d a}\) \(194\)
parts \(\frac {B \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right )}{d a}-\frac {C \sqrt {a \left (1+\sec \left (d x +c \right )\right )}\, \left (\ln \left (\sqrt {\cot \left (d x +c \right )^{2}-2 \cot \left (d x +c \right ) \csc \left (d x +c \right )+\csc \left (d x +c \right )^{2}-1}-\cot \left (d x +c \right )+\csc \left (d x +c \right )\right ) \sqrt {2}\, \sqrt {-\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}+2 \cot \left (d x +c \right )-2 \csc \left (d x +c \right )\right )}{d a}\) \(207\)

input
int((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^(1/2),x,method=_RETURNV 
ERBOSE)
 
output
1/d/a*(-2*a/((1-cos(d*x+c))^2*csc(d*x+c)^2-1))^(1/2)*(B*ln(csc(d*x+c)-cot( 
d*x+c)+((1-cos(d*x+c))^2*csc(d*x+c)^2-1)^(1/2))*((1-cos(d*x+c))^2*csc(d*x+ 
c)^2-1)^(1/2)-C*ln(csc(d*x+c)-cot(d*x+c)+((1-cos(d*x+c))^2*csc(d*x+c)^2-1) 
^(1/2))*((1-cos(d*x+c))^2*csc(d*x+c)^2-1)^(1/2)+2*C*(-cot(d*x+c)+csc(d*x+c 
)))
 
3.4.88.5 Fricas [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 287, normalized size of antiderivative = 3.68 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=\left [-\frac {\sqrt {2} {\left ({\left (B - C\right )} a \cos \left (d x + c\right ) + {\left (B - C\right )} a\right )} \sqrt {-\frac {1}{a}} \log \left (\frac {2 \, \sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, \cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right )^{2} + 2 \, \cos \left (d x + c\right ) + 1}\right ) - 4 \, C \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right ) + a d\right )}}, \frac {2 \, C \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right ) - \frac {\sqrt {2} {\left ({\left (B - C\right )} a \cos \left (d x + c\right ) + {\left (B - C\right )} a\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{\sqrt {a}}}{a d \cos \left (d x + c\right ) + a d}\right ] \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^(1/2),x, algorith 
m="fricas")
 
output
[-1/2*(sqrt(2)*((B - C)*a*cos(d*x + c) + (B - C)*a)*sqrt(-1/a)*log((2*sqrt 
(2)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sqrt(-1/a)*cos(d*x + c)*sin(d* 
x + c) + 3*cos(d*x + c)^2 + 2*cos(d*x + c) - 1)/(cos(d*x + c)^2 + 2*cos(d* 
x + c) + 1)) - 4*C*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/( 
a*d*cos(d*x + c) + a*d), (2*C*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin( 
d*x + c) - sqrt(2)*((B - C)*a*cos(d*x + c) + (B - C)*a)*arctan(sqrt(2)*sqr 
t((a*cos(d*x + c) + a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c)))/ 
sqrt(a))/(a*d*cos(d*x + c) + a*d)]
 
3.4.88.6 Sympy [F]

\[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}}{\sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )}}\, dx \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+a*sec(d*x+c))**(1/2),x)
 
output
Integral((B + C*sec(c + d*x))*sec(c + d*x)/sqrt(a*(sec(c + d*x) + 1)), x)
 
3.4.88.7 Maxima [F]

\[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=\int { \frac {C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right )}{\sqrt {a \sec \left (d x + c\right ) + a}} \,d x } \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^(1/2),x, algorith 
m="maxima")
 
output
integrate((C*sec(d*x + c)^2 + B*sec(d*x + c))/sqrt(a*sec(d*x + c) + a), x)
 
3.4.88.8 Giac [A] (verification not implemented)

Time = 1.19 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.68 \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=-\frac {\frac {2 \, \sqrt {2} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )} + \frac {{\left (\sqrt {2} B - \sqrt {2} C\right )} \log \left ({\left | -\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \right |}\right )}{\sqrt {-a} \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}}{d} \]

input
integrate((B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+a*sec(d*x+c))^(1/2),x, algorith 
m="giac")
 
output
-(2*sqrt(2)*sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a)*C*tan(1/2*d*x + 1/2*c)/((a 
*tan(1/2*d*x + 1/2*c)^2 - a)*sgn(cos(d*x + c))) + (sqrt(2)*B - sqrt(2)*C)* 
log(abs(-sqrt(-a)*tan(1/2*d*x + 1/2*c) + sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + 
a)))/(sqrt(-a)*sgn(cos(d*x + c))))/d
 
3.4.88.9 Mupad [F(-1)]

Timed out. \[ \int \frac {B \sec (c+d x)+C \sec ^2(c+d x)}{\sqrt {a+a \sec (c+d x)}} \, dx=\int \frac {\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}}{\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]

input
int((B/cos(c + d*x) + C/cos(c + d*x)^2)/(a + a/cos(c + d*x))^(1/2),x)
 
output
int((B/cos(c + d*x) + C/cos(c + d*x)^2)/(a + a/cos(c + d*x))^(1/2), x)